<% 
	String path = request.getContextPath();
	if(path.equals("/")){
		path = "";
	}
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<script type="text/javascript">
	var ctx = "<%=basePath%>";
</script>